import { createStore } from 'vuex'

export default createStore({
  state: {
    score: 0,
    record: 0,
    restart: true
  },
  getters: {
  },
  mutations: {
    updateScore(state, score) {
      state.score = score
    },
    updateRecord(state, record) {
      if(state.record < record) {
        state.record = record
      }
    },
    updateRestart(state, restart) {
      state.restart = restart
    }
  },
  actions: {
  },
  modules: {
  }
})
